//
//  MusicListCollectionViewCell.m
//  哎游
//
//  Created by 康守帅 on 15-1-6.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "MusicListCollectionViewCell.h"
#import "macro.h"

@implementation MusicListCollectionViewCell

- (void)dealloc
{
    [_albumImageView release];
    [_name release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
//        self.contentView.backgroundColor = [UIColor blackColor];
//        self.albumImageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, CELL_WIDTH / 2 - 10 - 5 - 10, CELL_WIDTH / 2 - 10 - 5)];
        self.albumImageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 0, self.frame.size.width - 20, self.frame.size.width - 20)];
        [self.contentView addSubview:_albumImageView];
        [_albumImageView release];
        
        UIView *maskView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width - 20, self.frame.size.width - 20)];
        maskView.backgroundColor = [UIColor blackColor];
        maskView.alpha = 0.2;
        [_albumImageView addSubview:maskView];
        [maskView release];
        
        UIImageView *playImageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.albumImageView.frame.size.width - 50, self.albumImageView.frame.size.width - 50, 40, 40)];
        UIImage *playImage = [UIImage imageNamed:@"play.png"];
        playImageView.image = playImage;
        [self.albumImageView addSubview:playImageView];
        [playImageView release];
        
        self.name = [[UILabel alloc] initWithFrame:CGRectMake(10, self.frame.size.width - 20, self.frame.size.width - 20, 30)];
        _name.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:_name];
        [_name release];
    }
    return self;
}


@end
